package com.example.rentsystem.mapper;

import com.example.rentsystem.entity.Advice;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AdviceMapper {

    @Insert("insert into advice(content, time) VALUES(#{content}, #{time})")
    int addAdvice(Advice advice);

    @Delete("delete from advice where id = #{id}")
    int deleteAdvice(int id);

    @Select("select * from advice")
    List<Advice> getAdvices();
}
